class Color:
    def __init__(self, r, g, b, a=255):
        self.red = r
        self.green = g
        self.blue = b
        self.alpha = a


class Matrix:
    def __init__(self, width, height):
        self.matrix = [[0 for i1 in range(width)] for i in range(height)]

    def __getitem__(self, item):
        return self.matrix[item]

    def __setitem__(self, key, value):
        self.matrix[key] = value

    def to_img(self):
        out = []
        for line in self.matrix:
            curr = []
            for col in line:
                curr.append((col.red, col.green, col.blue))
            out.append(curr)
        return out
